import {reqAddressInfo,reqGetorderInfo} from '../../api/index'
const state={
    userAddressInfo:[],
    orderInfo:[]
}
const actions={
    //1.获取地址信息
  async getAddress(context){
    let result=await reqAddressInfo()
    if(result.code===200){
       context.commit('GETADDRESS',result.data)
    }
   },
    //2.获取订单交易信息
  async getorderInfo(context){
    let result=await reqGetorderInfo()
    if(result.code===200){
       context.commit('GETORDERINFO',result.data)
    }
   }

}
const mutations={
    GETADDRESS(state,value){
        state.userAddressInfo=value
    },
    GETORDERINFO(state,value){
        state.orderInfo=value
    }
}
const getters={

}
export default{
    state,actions,mutations,getters
}